import VueRouter from 'vue-router'



//导入对应的组件
import HomeComper from './compensation/tabber/HomeConper.vue';
import MemberComper from './compensation/tabber/MemberComper.vue';
import SearchComper from './compensation/tabber/SearchComper.vue';
import ShopcarComper from './compensation/tabber/ShopcarComper.vue';
//新闻列表页面
import Newslist from './compensation/news/newslist.vue';
//新闻列表页面详情
import Newsinfo from './compensation/news/newsinfo.vue';
//图片分享
import Photolist from './compensation/news/photolist.vue';
//图片详情
import Photoinfo from './compensation/phonos/photoinfo.vue';
//商品购买列表
import Goodslist from './compensation/goods/goodslist.vue';
//商品详情页面
import Goodsinfo from './compensation/goods/goodsinfo.vue';
import Godesc from './compensation/goods/godesc.vue';
import Gocomment from './compensation/goods/gocomment.vue';


// 3. 创建路由对象
var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home' },
        { path: '/home', component: HomeComper },
        { path: '/member', component: MemberComper },
        { path: '/shopcar', component: ShopcarComper },
        { path: '/search', component: SearchComper },
        { path: '/home/newslist', component: Newslist },
        { path: '/home/newsinfo', component: Newsinfo },
        { path: '/home/photolist', component: Photolist },
        // { path: '/home/photoinfo/:id', component: Photoinfo }   带id
        { path: '/home/photoinfo', component: Photoinfo },
        { path: '/home/goodslist', component: Goodslist },
        { path: '/home/goodsinfo', component: Goodsinfo },
        { path: '/home/godesc/:id', component: Godesc, name: 'godesc' },
        { path: '/home/gocomment/:id', component: Gocomment, name: 'gocomment' },
    ],
    linkActiveClass: 'mui-zctive'    //覆盖默认的高亮的类
})

// 把路由对象暴露出去
export default router